﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InfoReaderLib.Parser.SimpleParser
{
    public sealed class Setting
    {
        /// <summary>
        /// The regular expression to extract InfoList from page
        /// </summary>
        public string ListRegEx { get; set; }

        public SettingListRegExMapping ListRegExMapping { get; set; }

        /// <summary>
        /// The regular expression to extract InfoDetail content from page
        /// </summary>
        public string DetailRegEx { get; set; }

        public SettingDetailRegExMapping DetailRegExMapping { get; set; }
    }

    /// <summary>
    /// The group number in regex maps to different fields of information.
    /// If more than one group belongs to same field,
    /// parser will concat them with a space character in between.
    /// </summary>
    public sealed class SettingListRegExMapping
    {
        public IList<int> Title { get; set; }
        public IList<int> Url { get; set; }
        public IList<int> Date { get; set; }
        public IList<int> Author { get; set; }
    }

    /// <summary>
    /// The group number in regex maps to different fields of information.
    /// If more than one group belongs to same field,
    /// parser will concat them with a space character in between.
    /// </summary>
    public sealed class SettingDetailRegExMapping
    {
        public IList<int> Title { get; set; }
        public IList<int> Date { get; set; }
        public IList<int> Author { get; set; }
        public IList<int> Article { get; set; }
    }
}
